<?php
if (eregi(basename( __FILE__ ), $_SERVER['PHP_SELF'])) {
	print "<h1>Incorrect access</h1>You cannot access this file directly.";
	exit();
}

//////////////CONTROL PANEL Authenticate Protect for EnBac.com///////////////
/* 

   $passwd = array('username_1' => 'password_1',
                   'username_2' => 'password_2',
                   // ...
                   'username_n' => 'password_n');

*/



/*if (stristr($_SERVER['SCRIPT_NAME'], "auth.php")) {
	print "<h1>Incorrect access</h1>You cannot access this file directly.";
	exit();
}*/



define ( 'AUTH', 1 );

$passwd = array(
	'tuannk' 	=> 'abc123',
);



if( AUTH ){
if (!isset($_SERVER['PHP_AUTH_USER']) ||
    !isset($_SERVER['PHP_AUTH_PW']) ||
    !isset($passwd[$_SERVER['PHP_AUTH_USER']]) ||
    $passwd[$_SERVER['PHP_AUTH_USER']] != $_SERVER['PHP_AUTH_PW']) {
  header('WWW-Authenticate: Basic realm="EnBac Control Panel"');
  header('HTTP/1.0 401 Unauthorized');
  $az_login = false;
} else {
  $az_login = true;
}
if (!$az_login)
{
echo "<html>
<title>AzNetGroup.com - Mạng mua bán, đấu giá trực tuyến</title>
<style type=\"text/css\">
body{ 
	background: #FFF;
	color: #222;
	font-family:  Tahoma,Verdana, Arial;
	font-size: 8pt;
	line-height: 135%;
	margin: 0;
	margin-top: 20px;
	padding: 0;
	text-align: center;
}
</style>
<body>

<h1>Access denied</h1>

</body>
</html>";
  exit;
}
}
?>